import { Context, Schema } from 'koishi'
import {} from 'koishi-plugin-adapter-onebot'

export const name = 'haz-fuck'

export interface Config {

  file: string

}

export const Config: Schema<Config> = Schema.intersect([

  Schema.object({
    file: Schema.string()
      .default("http://192.168.31.233:55555/哈子的Fuck.mp3")
  })

])

export function apply(ctx: Context, config: Config) {

  ctx.command('fuck')
    .action( async ( {session, options} ) => {
      await session.onebot._request(
        'send_group_msg',
        {
          "group_id": session.channelId,
          "message": [
            {
              "type": "record",
              "data": {
                "file": config.file
              }
            }
          ]
        }
      )
    })

}
